package com.fzj.example.design.state;

/**
* @Description 上下文
* @Author  fanzj
* @Date   2020/5/10 6:58 下午
* @Param  
* @Return      
* @Exception   
* 
*/
public class Context {
    private State state;

    public Context(State state) {
        this.state = state;
    }

    public Context() {
        this.state=new ConcreteStateA();
    }

    public void setState(State state) {
        this.state = state;
    }

    public State getState() {
        return state;
    }

    public void handler(){
        this.state.handle(this);
    }
}
